<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <script src="1.js"></script>
    <title>Document</title>
  </head>
  <body>
    <script>
      let email = '451430050@qq.com'
      //   console.log(email.match(/(\w+)(@\w+\.com)/))
      let newemail = email.replace(/(\w+)(@\w+\.com)/, function (...a) {
        return a[1].slice(0, -3) + '*'.repeat(3) + a[2]
      })
      console.log(newemail)
    </script>
  </body>
</html>
